home *** CD-ROM | disk | FTP | other *** search
- package asp.wizard;
-
- import asp.netobjects.nfx.wizard.WizardPage;
- import asp.util.ResourceUtil;
- import asp.wizard.def.DefAbstract;
- import asp.wizard.def.DefCollection;
- import asp.wizard.def.DefPage;
- import java.util.Enumeration;
-
- public class WizardViewFinish extends WizardViewAbstract {
- private static WizardViewAbstract _instance = null;
- private static WVPanelFinish _mainPanel = null;
- private static final String ID_LBL_CREATE_PREFIX = "label.createprefix";
- private static final String ID_LBL_CREATE_SUFFIX = "label.createsuffix";
- // $FF: synthetic field
- static Class class$asp$wizard$WVPanelFinish;
- // $FF: synthetic field
- static Class class$asp$wizard$def$DefDynaField;
-
- public static WizardViewAbstract getInstance() {
- if (_instance == null) {
- _instance = new WizardViewFinish();
- }
-
- return _instance;
- }
-
- protected void createMainPanel() {
- _mainPanel = new WVPanelFinish();
- }
-
- public WVPanelBase getMainPanel() {
- return _mainPanel;
- }
-
- public void setModel(WizardPage model) {
- super.setModel(model);
- DefPage defPage = ((WizardModelAbstract)model).getWizardManager().getFirstDefPage();
- _mainPanel._txaReport.setText(this.getMainText(defPage));
- }
-
- public String getMainText(DefPage defPage) {
- String result = "";
- result = result + this.getPageText(defPage) + "\n";
- result = result + this.getChildText(defPage) + "\n";
- return result;
- }
-
- public String getChildText(DefPage defPage) {
- String result = "";
- DefCollection defCollection = defPage.getChildPages();
-
- for(Enumeration e = defCollection.getElements(); e.hasMoreElements(); result = result + this.getChildText(defPage)) {
- defPage = (DefPage)e.nextElement();
- result = result + this.getPageText(defPage) + "\n";
- }
-
- return result;
- }
-
- public String getPageText(DefPage defPage) {
- String sCreatePrefix = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$WVPanelFinish != null ? class$asp$wizard$WVPanelFinish : (class$asp$wizard$WVPanelFinish = class$("asp.wizard.WVPanelFinish")), "label.createprefix");
- String sCreateSuffix = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$WVPanelFinish != null ? class$asp$wizard$WVPanelFinish : (class$asp$wizard$WVPanelFinish = class$("asp.wizard.WVPanelFinish")), "label.createsuffix");
- String result = "";
- result = "\n" + sCreatePrefix + " " + ((DefAbstract)defPage).getName() + " " + sCreateSuffix + "\n";
- Enumeration e = ((DefCollection)defPage).getElements();
- boolean hasDynafields = false;
- int cnt = 0;
-
- while(e.hasMoreElements()) {
- Object el = e.nextElement();
- if (!(class$asp$wizard$def$DefDynaField != null ? class$asp$wizard$def$DefDynaField : (class$asp$wizard$def$DefDynaField = class$("asp.wizard.def.DefDynaField"))).isInstance(el) || !hasDynafields) {
- if (cnt == 0) {
- result = result + " ";
- } else {
- result = result + ", ";
- }
-
- result = result + this.getGenericClassName(el.getClass().toString());
- ++cnt;
- }
-
- if ((class$asp$wizard$def$DefDynaField != null ? class$asp$wizard$def$DefDynaField : (class$asp$wizard$def$DefDynaField = class$("asp.wizard.def.DefDynaField"))).isInstance(el)) {
- hasDynafields = true;
- }
- }
-
- return result;
- }
-
- public String getGenericClassName(String wholeName) {
- String result = "";
- String key = "";
- if (wholeName.compareTo("class asp.wizard.def.DefConnection") == 0) {
- key = "label.connectionname";
- } else if (wholeName.compareTo("class asp.wizard.def.DefQuery") == 0) {
- key = "label.queryname";
- } else if (wholeName.compareTo("class asp.wizard.def.DefList") == 0) {
- key = "label.listname";
- } else if (wholeName.compareTo("class asp.wizard.def.DefPage") == 0) {
- key = "label.pagename";
- } else {
- key = "label.dynafieldsname";
- }
-
- if (key.length() > 0) {
- result = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$WVPanelFinish != null ? class$asp$wizard$WVPanelFinish : (class$asp$wizard$WVPanelFinish = class$("asp.wizard.WVPanelFinish")), key);
- }
-
- return result;
- }
-
- // $FF: synthetic method
- static Class class$(String class$) {
- try {
- return Class.forName(class$);
- } catch (ClassNotFoundException forName) {
- throw new NoClassDefFoundError(((Throwable)forName).getMessage());
- }
- }
- }
-